package D525;

import java.sql.SQLException;
//调用数据访问层的方法
public class StudentServiceImpl implements StudentService {
    //        创建数据访问层的对象
    private StudentDao studentDao = new  StudentDaoImpl();
    public StudentServiceImpl() throws SQLException, ClassNotFoundException {
    }
    @Override
    public int add(Student student) throws SQLException, ClassNotFoundException {
//        调用数据访问层的添加方法
        return studentDao.add(student);

    }

    @Override
    public Student login(String studentName, String studentPassword) throws SQLException {

        return studentDao.login(studentName,studentPassword);
    }
}
